package com.ms.service.serviceRegister;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by qihao on 2018/1/18.
 */
@Configuration
@ConfigurationProperties(prefix = "registry")
public class RegistryConfig {
    private String servers;
    @Bean
    public ServiceRegistry serviceRegistry() {
        System.out.println( "Registry config creating ServiceRegistry ");
        return new ServiceRegistryImpl( servers);
    }
    public void setServers( String servers) {
        this. servers = servers;
    }

}
